<?php
class NavWidget extends Widget{

	public function render($data){
		//--导航条------------------------------------------------
			/*
				Left Nav
			*/
			foreach(C('Nav') as $v){
				foreach($v as $vo){
					$rule[] = $vo; 	
				}	
			};
			$nav_uid = get_user_group(session('adminId'),'id');
			$nav_group_rule = M('think_auth_group')->where(array('id'=>$nav_uid))->find();
			$nav_group_rule_arr = explode(',',$nav_group_rule['rules']);
			
			if(session('adminId') == C('adminId')){
				 foreach($rule as $v){
					$nav_name[] = $v;
				}
				   
			}else{
				foreach($nav_group_rule_arr as $v){
					$nav_name[] = $v;
				  }
			}
		    
			$data['nav_name_arr'] = $rule;
			$data['nav_list'] = C('NAV');
			$data['nav_name'] = $nav_name;
		
		return $this->renderFile('',$data);
	}
}

?>
